Next, a sample description is prepared. This is identical to the sample description that would be prepared if the same effect was added to a QuickTime movie. The code in Listing 13 creates a sample description that selects Apple's SMPTE wipe ( 'smpt' ) effect.
Listing 13 Preparing a Sample Description
{
ImageDescriptionHandlemySampleDesc = NULL;
// create a new, empty sample description
mySampleDesc =
(ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription));
// fill in the fields of the sample description
(**mySampleDesc).idSize = sizeof(ImageDescription);
(**mySampleDesc).cType = 'smpt';
(**mySampleDesc).vendor = kAppleManufacturer;
(**mySampleDesc).temporalQuality = codecNormalQuality;
(**mySampleDesc).spatialQuality = codecNormalQuality;
(**mySampleDesc).width = theWidth;
(**mySampleDesc).height = theHeight;
(**mySampleDesc).hRes = 72L << 16;
(**mySampleDesc).vRes = 72L << 16;
(**mySampleDesc).frameCount = 1;
(**mySampleDesc).depth = 0;
(**mySampleDesc).clutID = -1;
return(mySampleDesc);
}
| Previous | Chapter Contents | Chapter Top | Next |